package com.ruoyi.procured.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName tb_procured_product
 */
@TableName(value ="tb_procured_product")
@Data
public class ProcuredProduct implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品编号 （从100001开始递增的编码）
     */
    @TableField(value = "pro_no")
    private String proNo;

    /**
     * 供应商id
     */
    @TableField(value = "vendor_id")
    private Integer vendorId;

    /**
     * 产品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 产品价格
     */
    @TableField(value = "product_price")
    private BigDecimal productPrice;

    /**
     * 数量
     */
    @TableField(value = "number")
    private Integer number;

    /**
     * 已转数量
     */
    @TableField(value = "turned_number")
    private Integer turnedNumber;

    /**
     * 可转数量
     */
    @TableField(value = "transferable_number")
    private Integer transferableNumber;

    /**
     * 金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 税率
     */
    @TableField(value = "rate")
    private String rate;

    /**
     * 税额
     */
    @TableField(value = "tax")
    private BigDecimal tax;

    /**
     * 含税金额
     */
    @TableField(value = "tax_included")
    private BigDecimal taxIncluded;

    /**
     * 备注
     */
    @TableField(value = "product_remark")
    private String productRemark;

    /**
     * 关联采购计划表(tb_purchase_plan)
     */
    @TableField(value = "plan_id")
    private Integer planId;

    /**
     * 删除状态 0存在1删除
     */
    @TableField(value = "delete_status")
    private String deleteStatus;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 是否选择状态
     */
    @TableField(value = "selected_status")
    private String selectedStatus;

    /**
     * 关联产品id(tb_product)
     */
    @TableField(value = "product_id")
    private Integer productId;

    /**
     * 版本号
     */
    @TableField(value = "version")
    private Integer version;

    /**
     * 交付时间
     */
    @TableField(value = "delivery_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deliveryTime;

    /**
     * 汇率
     */
    @TableField(value = "currency")
    private BigDecimal currency;

    /**
     * 运费
     */
    @TableField(value = "freight")
    private BigDecimal freight;

    /**
     * 是否是供应商付
     */
    @TableField(value = "is_supplier_pays_freight")
    private Boolean flag;

    /**
     * 货币单位id
     */
    @TableField(value = "monetary_id")
    private Integer monetaryId;

    /**
     * 1688订单号
     */
    @TableField(value = "order_no_1688")
    private String orderNo1688;

    /**
     * GTIN
     */
    @TableField(value = "gtin")
    private String gtin;

    /**
     * 原采购数量（这个字段是用于销售计划明细提前结束使用到的）
     */
    @TableField(value = "original_purchase_quantity")
    private String originalPurchaseQuantity;

    /**
     * SKU
     */
    @TableField(exist = false)
    private String sku;

    /**
     * 是否全部退货或者退款完毕（0：否, 1：是
     */
    @TableField(value = "return_completed_status")
    private Integer returnCompletedStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProcuredProduct other = (ProcuredProduct) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getProNo() == null ? other.getProNo() == null : this.getProNo().equals(other.getProNo()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getProductPrice() == null ? other.getProductPrice() == null : this.getProductPrice().equals(other.getProductPrice()))
            && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
            && (this.getTurnedNumber() == null ? other.getTurnedNumber() == null : this.getTurnedNumber().equals(other.getTurnedNumber()))
            && (this.getTransferableNumber() == null ? other.getTransferableNumber() == null : this.getTransferableNumber().equals(other.getTransferableNumber()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getRate() == null ? other.getRate() == null : this.getRate().equals(other.getRate()))
            && (this.getTax() == null ? other.getTax() == null : this.getTax().equals(other.getTax()))
            && (this.getTaxIncluded() == null ? other.getTaxIncluded() == null : this.getTaxIncluded().equals(other.getTaxIncluded()))
            && (this.getProductRemark() == null ? other.getProductRemark() == null : this.getProductRemark().equals(other.getProductRemark()))
            && (this.getPlanId() == null ? other.getPlanId() == null : this.getPlanId().equals(other.getPlanId()))
            && (this.getDeleteStatus() == null ? other.getDeleteStatus() == null : this.getDeleteStatus().equals(other.getDeleteStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getSelectedStatus() == null ? other.getSelectedStatus() == null : this.getSelectedStatus().equals(other.getSelectedStatus()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProNo() == null) ? 0 : getProNo().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getProductPrice() == null) ? 0 : getProductPrice().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getTurnedNumber() == null) ? 0 : getTurnedNumber().hashCode());
        result = prime * result + ((getTransferableNumber() == null) ? 0 : getTransferableNumber().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getRate() == null) ? 0 : getRate().hashCode());
        result = prime * result + ((getTax() == null) ? 0 : getTax().hashCode());
        result = prime * result + ((getTaxIncluded() == null) ? 0 : getTaxIncluded().hashCode());
        result = prime * result + ((getProductRemark() == null) ? 0 : getProductRemark().hashCode());
        result = prime * result + ((getPlanId() == null) ? 0 : getPlanId().hashCode());
        result = prime * result + ((getDeleteStatus() == null) ? 0 : getDeleteStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getSelectedStatus() == null) ? 0 : getSelectedStatus().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", proNo=").append(proNo);
        sb.append(", productName=").append(productName);
        sb.append(", productPrice=").append(productPrice);
        sb.append(", number=").append(number);
        sb.append(", turnedNumber=").append(turnedNumber);
        sb.append(", transferableNumber=").append(transferableNumber);
        sb.append(", amount=").append(amount);
        sb.append(", rate=").append(rate);
        sb.append(", tax=").append(tax);
        sb.append(", taxIncluded=").append(taxIncluded);
        sb.append(", productRemark=").append(productRemark);
        sb.append(", planId=").append(planId);
        sb.append(", deleteStatus=").append(deleteStatus);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", selectedStatus=").append(selectedStatus);
        sb.append(", productId=").append(productId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}